<script>
	import checkVersion from '@/uni_modules/uni-upgrade-center-app/utils/check-update.js';
	import {
		mapState,
		mapMutations
	} from 'vuex';
	export default {
		onLaunch: function() {
			checkVersion()
			let _this = this
			console.log('App Launch')
			let shopInfo = uni.getStorageSync("shopInfo")
			if (shopInfo != '') {
				//通过token验证用户信息是否过期
				uni.getStorage({
					key: 'shopInfo',
					success(res) {
						_this.login(res.data)
						//验证登录是否过期
						_this.$api.checkShopLogin({}).then((res) => {

						})
					}
				})

			}
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {
			...mapMutations(['login']),
		},
	}
</script>

<style>
	/*每个页面公共css */
	/* 官方ui库 */

	@import "/common/uni.css";
	/* 第三方动画库 */
	@import "/common/animate.css";
	/* 自定义图标库 */
	@import "/common/icon.css";
	/* UI基础库 */
	@import "/common/zcm-main.css";
	@import "/common/common.css";
</style>
